<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>home 地图 </title>
     <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAsnD6g25AONVvr5_uQnxNMhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR2cLQuGnOrK47JDGlIBIlcD_w_jA"></script>

        <script type="text/javascript">
          google.load("maps", "2");

          function initialize() {
            var map = new google.maps.Map2(document.getElementById("map_canvas"));
            var center = new google.maps.LatLng(${user.lat},${user.lng});
            map.setCenter(center, 14);
            map.openInfoWindow(map.getCenter(),document.createTextNode("Hi,${sessionUsername} !欢迎来到ideamaps"));
            map.addControl(new GLargeMapControl());
            var currentMaker = new GMarker(center, {draggable: true});
            map.addOverlay(currentMaker);
            google.maps.Event.addListener(map, "click", function(marker, point) {
                document.getElementById("lat").value = point.y;
                document.getElementById("lng").value = point.x;
                currentMaker.setPoint(point);
            });
            GEvent.addListener(currentMaker, "dragend", function() {
                document.getElementById("lat").value = currentMaker.getPoint().y;
                document.getElementById("lng").value = currentMaker.getPoint().x;
            });
          }
          google.setOnLoadCallback(initialize);
        </script>
  </head>
  <body  onunload="GUnload()">
    <h2>home</h2>
     screenName：${user.screenName}<br>
     email：${user.email}<br>
     gender：<s:if test="user.gender==0">
             男
           </s:if>  
           <s:else>
            女
           </s:else> 
     <br>
     status：${user.status}<br>
    <div id="map_canvas" style="width: 500px; height: 300px ;border:1px solid red;"></div>
  
  </body>
  
  
</html>

